home *** CD-ROM | disk | FTP | other *** search
Wrap
package Code.WINDOWS { import Code.FIELD._dq803; import Code.FIELD.helpers.TShapeType; import Code.LIB.SOUND._bu111; import Code.LIB._be548; import Code.LIB._cg33; import Code.LIB._ct751; import Code.LIB._gt710; import Code.LIB._my111; import Code.LIB._oo505; import Code.LIB._rs402; import Code.LIB._sb428; import Code.LIB._se17; import Code.LIB._tk11; import Code.LIB._vx23; import Code.LIB._wy567; import Code.LIB.animators._aj302; import Code.LIB.animators._do643; import Code.LIB.animators._lv705; import Code.LIB.animators._wr378; import Code.OPTIONS.LEVELS; import Code.OPTIONS._gs337; import Code.WINDOWS.DIALOGS._fl44; import Code.WINDOWS.SHOWS._st232; import Code._fi197; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.geom.Point; import flash.net.URLRequest; import flash.net.navigateToURL; import flash.utils.getTimer; import mochi.as3.MochiScores; public class _wl522 extends _gt710 { public static const stShow:int = 0; public static const stLevel:int = 3; public static const stPlay:int = 4; public static const stComplete:int = 5; public static const stCompleteAllRoundz:int = 6; public static const stCompleteAllSquarez:int = 7; public static const stLoose:int = 8; public static const stCompleteAllLevels:int = 9; public static const stInvisible:int = 10; public static const stMenuConfirm:int = 11; public static const stPaused:int = 12; private static const TWCompleteParams:Array = [[_fi197._ww533,8286134,580,400,true,40,40,null,true],[_fi197._pm137,"Great, level completed!",_gs337.TColors,39,_my111.SmallText,220,60,null,true],[_fi197._xy367,"level score:",_gs337.cWhite,35,_my111.SmallText,50,120,"levelScore",true],[_fi197._xy367,"total score:",_gs337.cWhite,35,_my111.SmallText,50,160,"totalScore",true],[_fi197._tr788,"submit score",0,180,50,19,_gs337.cWhite,"submit_score",275,130,null,true],[_fi197._tr788,"next level",2,180,60,20,_gs337.cWhite,"next_level",55,270,null,true],[_fi197._pc92,"more games",0,180,60,18,_gs337.cWhite,"more_games",55,340,null,true]]; private static const TWCompleteAllRoundzParams:Array = [[_fi197._ww533,_gs337.cGellGreen,580,400,true,40,40,null,true],[_fi197._pm137,"Great, you have completed all Roundz levels!\n Get ready to play in Squarez mode!",_gs337.TColors,40,_my111.SmallText,100,60,null,true],[_fi197._xy367,"level score:",_gs337.cWhite,35,_my111.SmallText,120,170,"levelScore",true],[_fi197._xy367,"total score:",_gs337.cWhite,35,_my111.SmallText,120,230,"totalScore",true],[_fi197._tr788,"next level",2,200,60,20,_gs337.cWhite,"next_level",245,310,null,true]]; private static const TWCompleteAllSquarezParams:Array = [[_fi197._ww533,_gs337.cGellGreen,580,400,true,40,40,null,true],[_fi197._pm137,"Great, you have completed all Squarez levels!\n Get ready to play in Roundz mode!",_gs337.TColors,40,_my111.SmallText,100,60,null,true],[_fi197._xy367,"level score:",_gs337.cWhite,35,_my111.SmallText,120,170,"levelScore",true],[_fi197._xy367,"total score:",_gs337.cWhite,35,_my111.SmallText,120,230,"totalScore",true],[_fi197._tr788,"next level",2,200,60,20,_gs337.cWhite,"next_level",245,310,null,true]]; private static const TWLevelFailed:Array = [[_fi197._ww533,_gs337.cGellPink,440,340,true,0,0,null,true],[_fi197._xy367,"level failed \n try again!",_gs337.cWhite,40,null,135,50,null,true],[_fi197._tr788,"play again",0,220,60,17,_gs337.cWhite,"play_again",100,160,null,true],[_fi197._pc92,"more games",0,220,60,20,_gs337.cWhite,"more_games",100,240,null,true]]; private static const TWCompleteAllParams:Array = [[_fi197._ww533,8286134,580,400,true,30,20,null,true],[_fi197._xy367," Congratulations!\nYou have completed all levels!!!",_gs337.cWhite,34,_my111.SmallText,200,35,null,true],[_fi197._xy367,"level score:",_gs337.cWhite,35,_my111.SmallText,120,140,"levelScore",true],[_fi197._xy367,"total score:",_gs337.cWhite,35,_my111.SmallText,120,185,"totalScore",true],[_fi197._tr788,"play again",2,220,60,20,_gs337.cWhite,"play_again",220,230,null,true],[_fi197._pc92,"submit score",0,200,60,19,_gs337.cWhite,"submit_score",340,310,null,true],[_fi197._pc92,"more games",0,200,60,19,_gs337.cWhite,"more_games",110,310,null,true]]; public var pause:_ct751; private var dMenu:_fl44; private var msgs:Array; public var iLevelLabel:_wy567; private var iField:_dq803; private var iScoreBut:_ct751; public var menu:_ct751; private var allLevels:Boolean = false; private var stateStack:int; private var iMsgLabel:_wy567; private var submitDialog:_fl44; private var score:_sb428; private var showWindow:_st232; private var iState:int; public var iPauseLabel:_wy567; public function _wl522() { var _loc1_:Array = null; var _loc2_:Array = null; var _loc3_:_oo505 = null; allLevels = false; _loc1_ = [[_fi197._pc92,_gs337.iLanguage.strMenu,_gs337.cAqua,80,35,17,_gs337.cWhite,545,430,"menu",true],[_fi197._tr788,_gs337.iLanguage.strPause,_gs337.cAqua,80,35,17,_gs337.cWhite,545,380,"pause",true],[_fi197._xy367,(_vx23._pm756 + 1) / _vx23._qq496,_gs337.cWhite,20,null,680,50,null,false],[_fi197._xy367,_gs337.iLanguage.strPaused,_gs337.cWhite,44,_my111.BigText,40,150,"iPauseLabel",false]]; _loc2_ = TWCompleteParams[4]; _loc2_[_loc2_.length - 1] = !_cg33._dn742; _loc2_ = TWCompleteAllParams[5]; _loc2_[_loc2_.length - 1] = !_cg33._dn742; super(_loc1_); score = new _sb428(20,_gs337.cWhite,"level score\n"); score.alpha = 1; score._yc70 = 0; score.visible = false; score._vg471 = 10; score._vq458 = 447; addChild(score); _loc3_ = _tk11._ln87(new _gs337.TFieldBG() as Sprite); addChildAt(_loc3_,0); _pp317(); } public function _pp317() : void { this.iMsgLabel = new _wy567(40,_gs337.cAqua,_my111.Bevel); this.addChild(this.iMsgLabel); this.iMsgLabel.mouseEnabled = false; _rs402.prStage.addEventListener(Event.DEACTIVATE,_nj225); } override public function _ba289(param1:MouseEvent) : void { var _loc2_:String = null; var _loc3_:* = null; if(Boolean(submitDialog) && (param1.target == submitDialog.iOk._en365 || param1.target == submitDialog.iCancel._en365)) { switch(param1.target) { case submitDialog.iOk._en365: _loc2_ = int(_rs402.prStage.stageWidth) + "x" + int(_rs402.prStage.stageHeight); MochiScores._rh570({ "boardID":"6c4dfd82c9e388bd", "score":_vx23._om626, "res":_loc2_, "onError":_mf701 }); _cg33._dn742 = true; iScoreBut.visible = false; break; case submitDialog.iCancel._en365: } removeChild(submitDialog); submitDialog._dx150(); submitDialog = null; return; } switch(iState) { case stPlay: if(param1.target == pause._en365) { iField.pause = !iField.pause; iPauseLabel.visible = iField.pause; } break; case stLoose: if(param1.target.parent is _ct751 && _ct751(param1.target.parent).ID == "play_again") { (parent as _se17).menuItem = _gs337.miGame; hide(); State = stInvisible; } break; case stComplete: if(param1.target.parent is _ct751 && _ct751(param1.target.parent).ID == "next_level") { (parent as _se17).menuItem = _gs337.miGame; hide(); State = stInvisible; } break; case stCompleteAllRoundz: if(param1.target.parent is _ct751 && _ct751(param1.target.parent).ID == "next_level") { (parent as _se17).menuItem = _gs337.miGame; hide(); State = stInvisible; } break; case stCompleteAllSquarez: if(param1.target.parent is _ct751 && _ct751(param1.target.parent).ID == "next_level") { (parent as _se17).menuItem = _gs337.miGame; hide(); State = stInvisible; } break; case stMenuConfirm: if(param1.target == dMenu._dg142._en365) { hide(); } else if(param1.target == dMenu._ta621._en365) { dMenu._dx150(); removeChild(dMenu); dMenu = null; iState = stateStack; } break; case stCompleteAllLevels: if(param1.target.parent is _ct751 && _ct751(param1.target.parent).ID == "play_again") { (parent as _se17).menuItem = _gs337.miGame; hide(); State = stInvisible; } } if(param1.target == menu._en365 && iState != stMenuConfirm) { State = stMenuConfirm; } if(param1.target.parent is _ct751 && _ct751(param1.target.parent).ID == "more_games") { _loc3_ = "http://www.bibagames.com/"; if(iState == stComplete) { _loc3_ += "?r=shape_smash_complete"; } else if(iState == stLoose) { _loc3_ += "?r=shape_smash_brgame"; } else if(iState == stCompleteAllLevels) { _loc3_ += "?r=shape_smash_endgame"; } navigateToURL(new URLRequest(_loc3_),"_blank"); } if(param1.target.parent is _ct751 && _ct751(param1.target.parent).ID == "submit_score") { submitDialog = new _fl44(" You can submit\n score only once.\n Are you sure?"); addChild(submitDialog); submitDialog._xe768(150,100); iScoreBut = param1.target.parent as _ct751; } } override public function _dx150() : void { super._dx150(); } public function _nj225(param1:Event) : void { if(iField) { iField.pause = true; iPauseLabel.visible = iField.pause; } } override public function onEnterFrame(param1:Event) : void { var _loc2_:int = 0; super.onEnterFrame(param1); _loc2_ = getTimer(); switch(this.iState) { case stShow: if(!this._fl746 && this._hy116) { this.State = stLevel; } break; case stLevel: if(this.iMsgLabel.alpha < 0.99) { this.iMsgLabel.alpha += 0.07; } if(_loc2_ - this.iITimer > 2500) { this.State = stPlay; } break; case stPlay: if(iField.alpha < 1) { iField.alpha += 1 / 50; } if(score._yc70 != iField.score) { score._yc70 = iField.score; } if(iField.State == _dq803.stWin) { State = stComplete; } else if(iField.State == _dq803.stGameOver) { State = stLoose; } break; case stComplete: case stLoose: } } public function _mf701(param1:Object = null) : void { _cg33._dn742 = false; trace("ON ERROR!"); } private function set State(param1:int) : void { var _loc2_:Array = null; var _loc3_:String = null; var _loc4_:_wr378 = null; var _loc5_:int = 0; var _loc6_:Object = null; var _loc7_:_tc365 = null; var _loc8_:_do643 = null; var _loc9_:_be548 = null; stateStack = iState; this.iState = param1; switch(this.iState) { case stShow: break; case stLevel: if(_vx23._xh67) { _vx23._ew523(); } if(_vx23._un44 == TShapeType.CIRCLE && _vx23._xp514) { _vx23._un44 = TShapeType.POLY; } else if(_vx23._un44 == TShapeType.POLY && _vx23._bu14) { _vx23._un44 = TShapeType.CIRCLE; } _loc2_ = TWCompleteParams[4]; _loc2_[_loc2_.length - 1] = !_cg33._dn742; _loc2_ = TWCompleteAllParams[5]; _loc2_[_loc2_.length - 1] = !_cg33._dn742; this.iMsgLabel.Color = _gs337.cWhite; this.iMsgLabel._gg765 = 60; _loc3_ = ""; _loc3_ += " " + (_vx23._un44 == TShapeType.CIRCLE ? _gs337.iLanguage.strRoundz : _gs337.iLanguage.strSquarez) + "\n"; _loc3_ += " " + _gs337.iLanguage.strLevel + " # " + (_vx23._pm756 + 1).toString() + "/" + _vx23._qq496; this.iMsgLabel.Text = _loc3_; this.iMsgLabel._xe768((500 - this.iMsgLabel.width) / 2,(600 - this.iMsgLabel.height) / 2); this.iMsgLabel.alpha = 0; this.iITimer = getTimer(); break; case stPlay: _loc4_ = new _wr378(iMsgLabel); _loc4_.animate({"toPoint":new Point(iMsgLabel._vq458 + 1500,iMsgLabel._vg471)}); _wk598(_loc4_); menu.visible = true; score.visible = true; _loc5_ = _vx23._pm756; _loc6_ = _vx23._un44 == TShapeType.CIRCLE ? LEVELS.RoundzLevels[_loc5_] : LEVELS.BlockzLevels[_loc5_]; this.iField = new _dq803(_loc6_,_vx23._un44,_loc5_ + 1); this.addChildAt(iField,1); iField.alpha = 0; break; case stComplete: _vx23._wt252(); _vx23._sh498(iField.score); if(_vx23._xh67) { State = stCompleteAllLevels; return; } if(_vx23._un44 == TShapeType.CIRCLE) { if(_vx23._xp514) { _vx23._un44 = TShapeType.POLY; State = stCompleteAllRoundz; return; } } else if(_vx23._bu14) { _vx23._un44 = TShapeType.CIRCLE; State = stCompleteAllSquarez; return; } showWindow = new _st232(TWCompleteParams); _loc7_ = new _tc365(true); showWindow.addChild(_loc7_); _loc7_._xe768(220,240); _loc7_.alpha = 1; _loc7_.isShowing = false; showWindow._ot632(); showWindow._aw141(showWindow.getChildAt(0)); showWindow.levelScore.Text = "Level score: " + iField.score; showWindow.totalScore.Text = "Total score: " + _vx23._om626; _loc8_ = new _lv705(showWindow,_lv705.HORIZONTAL); showWindow.startAnimation(_loc8_); addChild(showWindow); showWindow.alpha = 0.4; _bu111._wu209("maximize"); break; case stCompleteAllRoundz: showWindow = new _st232(TWCompleteAllRoundzParams); showWindow._ot632(); showWindow._aw141(showWindow.getChildAt(0)); showWindow.levelScore.Text = "Level score: " + iField.score; showWindow.totalScore.Text = "Total score: " + _vx23._om626; _loc8_ = new _lv705(showWindow,_lv705.HORIZONTAL); showWindow.startAnimation(_loc8_); addChild(showWindow); showWindow.alpha = 0.4; _bu111._wu209("maximize"); break; case stCompleteAllSquarez: showWindow = new _st232(TWCompleteAllSquarezParams); showWindow._ot632(); showWindow._aw141(showWindow.getChildAt(0)); showWindow.levelScore.Text = "Level score: " + iField.score; showWindow.totalScore.Text = "Total score: " + _vx23._om626; _loc8_ = new _lv705(showWindow,_lv705.HORIZONTAL); showWindow.startAnimation(_loc8_); addChild(showWindow); showWindow.alpha = 0.4; _bu111._wu209("maximize"); break; case stLoose: showWindow = new _st232(TWLevelFailed); showWindow._ot632(); showWindow._aw141(showWindow.getChildAt(0)); _loc9_ = new _be548(); _loc9_.addChild(showWindow); showWindow._xe768(-220,-135); _loc9_._xe768(310,195); _loc8_ = new _aj302(_loc9_,_aj302.ROTATE_AND_SHOW); showWindow.startAnimation(_loc8_); addChild(_loc9_); _bu111._wu209("maximize"); break; case stMenuConfirm: if(iField) { iField.pause = true; iPauseLabel.visible = iField.pause; } _bu111._wu209("maximize"); dMenu = new _fl44(" exit to menu?"); dMenu._xe768(60,30); addChild(dMenu); break; case stPaused: _bu111._wu209("maximize"); break; case stCompleteAllLevels: showWindow = new _st232(TWCompleteAllParams); showWindow._ot632(); showWindow._aw141(showWindow.getChildAt(0)); showWindow.levelScore.Text = "Level score: " + iField.score; showWindow.totalScore.Text = "Total score: " + _vx23._om626; _loc8_ = new _lv705(showWindow,_lv705.HORIZONTAL); showWindow.startAnimation(_loc8_); addChild(showWindow); _bu111._wu209("maximize"); } } } }